package com.geeke.test.entity;

import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.geeke.sys.entity.User;
import com.geeke.wf.persistence.WfDataEntity;

/**
 * 请假管理Entity
 * @author
 * @version
 */
public class Leave extends WfDataEntity<Leave> {

    private static final long serialVersionUID = 1382845380441571438L;

    private User leaver; // 请假人

    private String name; // 名称

    private Double days; // 请假天数

    // 构造方法
    public Leave() {
        super();
    }

    public Leave(String id) {
        super(id);
    }

    // 生成get和set方法

    @NotNull(message = "请假人不能为空")
    public User getLeaver() {
        return leaver;
    }

    public void setLeaver(User leaver) {
        this.leaver = leaver;
    }

    @Length(min = 0, max = 128, message = "名称长度必须介于 0 和 128 之间")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getDays() {
        return days;
    }

    public void setDays(Double days) {
        this.days = days;
    }

    /**
     * 获取实体对应表名
     */
    @Override
    @JsonIgnore
    public String getBusTableName() {
        return "test_leave";
    }

    /**
     * 获取实体对应Id
     */
    @Override
    @JsonIgnore
    public String getBusTableId() {
        return "1382845380441571438";
    }

    /**
     * 获取实体表中是否存在del_flag字段
     */
    @JsonIgnore
    public boolean getBusTableHasDelFlag() {
        return true;
    }
}
